package example.demo;

import com.alibaba.dubbo.config.annotation.Reference;
import example.demo.service.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@Slf4j
@SpringBootApplication
public class DubboConsumerApp {
    @Reference(version = "1.0.0"/*, url = "dubbo://localhost:12345"*/)
    private DemoService demoService;

    @Bean
    public ApplicationRunner runner() {
        return args -> {
            log.info(demoService.sayHello("mercyblitz"));
        };
    }

    public static void main(String[] args) {
        SpringApplication.run(DubboConsumerApp.class);
    }
}
